<!-- <?php
include_once("./Db_pdo.class.php");
include_once("../excel/excel.php");

ini_set('date.timezone','Asia/Shanghai');
$DB=new Db_pdo("test","root","root");

echo '<pre>';
 
set_time_limit(0);
$s =new excel();
$file =__DIR__.'/area.xls';


$data = $s->dtext($file);
// print_r($data); 
// exit;
$arr = array_chunk($data, 1000); 

foreach($arr as $v) {
	// print_r($v);
	
	$sql = "INSERT INTO area (`name`,`code`,`level`,`p_name`,`p_code`) VALUES ";
	foreach ($v as $value) { 
		
		
		$param['name'] =$value['1'];
		$param['code'] = $value['2'];
		$param['level'] =$value['3'];
		$param['p_name'] =$value['4'];
		$param['p_code'] = $value['5'];
		
		// $s.='(null,3,'.$value['id'].','.$value['need_back'].',0,0,'.$value['user_id'].','.$value['back_time'].'),';
		// echo $s;
	    $values="('".implode("','",array_values($param))."'),";
	    // echo $values;
	    $sql .= $values;
	}
	$sql = rtrim($sql, ",");
	//echo $sql;
	
	$DB->db->query($sql);
	//exit;
	// return ;
}
// print_r($data);
//file_put_contents('1.txt',serialize($data));



 -->